<%--
  Created by IntelliJ IDEA.
  User: tanggy
  Date: 2021/12/21
  Time: 16:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>首页</title>
  <style type="text/css">
    a {
      text-decoration: none;
      color: black;
      font-size: 18px;
    }
    h3 {
      width: 180px;
      height: 38px;
      margin: 100px auto;
      text-align: center;
      line-height: 38px;
      background: deepskyblue;
      border-radius: 4px;
    }
  </style>
  <script src="${pageContext.request.contextPath}/statics/jquery-3.6.0.js"></script>
  <script>
    function a1(){
      $.post({
        url:"${pageContext.request.contextPath}/a2",
        data:{'name':$("#txtName").val()},
        success:function (data,status) {
          console.log(data)
          console.log(status)
        },
        error:function (){

        }
      });
    }
  </script>
</head>
<body>

<h3>
  <a href="${pageContext.request.contextPath}/book/allBook">点击进入列表页</a>
</h3>

<%--onblur：失去焦点触发事件--%>
用户名:<label for="txtName"></label><input type="text" id="txtName" onblur="a1()"/>

<form action="/upload2" enctype="multipart/form-data" method="post">
  <input type="file" name="file"/>
  <input type="submit" value="upload">
</form>

<a href="/download">点击下载</a>
</body>
</html>
